package com.ruoyi.system.domain.summary;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * Created On : 2024/4/18.
 * Author : xuliang
 * Description: AnnualMetrics
 * <p>
 */
@Data
@ToString
public class AnnualMetrics {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    private Long id;

    @ExcelIgnore
    private Integer areaId;

    @ExcelProperty(value = {"序号","序号"})
    @ColumnWidth(8)
    private Integer no;

    @ExcelProperty(value = {"经营主体","经营主体"})
    @ColumnWidth(15)
    private String sectorName;

    /** 年度目标 */
    @ExcelProperty(value = {"新签合同额（含税）","年度目标"})
    @ColumnWidth(15)
    private BigDecimal contractMetrics;

    /** 实际完成 */
    @ExcelProperty(value = {"新签合同额（含税）","实际完成"})
    @ColumnWidth(15)
    private BigDecimal contractReal;

    /** 完成比率 */
    @ExcelProperty(value = {"新签合同额（含税）","完成比率"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double contractRate;

    /** 年度目标 */
    @ExcelProperty(value = {"含税结算收入（完工产值）","年度目标"})
    @ColumnWidth(15)
    private BigDecimal outputMetrics;

    /** 实际完成 */
    @ExcelProperty(value = {"含税结算收入（完工产值）","实际完成"})
    @ColumnWidth(15)
    private BigDecimal outputReal;

    /** 完成比率 */
    @ExcelProperty(value = {"含税结算收入（完工产值）","完成比率"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double outputRate;

    /** 年度目标 */
    @ExcelProperty(value = {"实现利润","年度目标"})
    @ColumnWidth(15)
    private BigDecimal profitMetrics;

    /** 实际完成 */
    @ExcelProperty(value = {"实现利润","实际完成"})
    @ColumnWidth(15)
    private BigDecimal profitReal;

    /** 完成比率 */
    @ExcelProperty(value = {"实现利润","完成比率"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double profitRate;

    /** 年度目标 */
    @ExcelProperty(value = {"利润率","年度目标"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double profitRateMetrics;

    /** 实际完成 */
    @ExcelProperty(value = {"利润率","实际完成"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double profitRateReal;

    /** 升+/降- */
    @ExcelProperty(value = {"利润率","升+/降-"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double profitRateUpDown;

    /** 年度目标 */
    @ExcelProperty(value = {"应收帐款回款率","年度目标"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double paymentRateMetrics;

    /** 实际完成 */
    @ExcelProperty(value = {"应收帐款回款率","实际完成"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double paymentRateReal;

    /** 升+/降- */
    @ExcelProperty(value = {"应收帐款回款率","升+/降-"})
    @ColumnWidth(10)
    @NumberFormat(value = "0.00%")
    private Double paymentRateUpDown;

    @ExcelIgnore
    private BigDecimal receivable;
    @ExcelIgnore
    private BigDecimal received;

    @ExcelIgnore
    private String dateNumber;

    public void setSectorName(){
        switch (this.areaId){
            case 3:
                sectorName = "房建板块";
                break;
            case 4:
                sectorName = "海外板块";
                break;
            case 5:
                sectorName = "市政板块";
                break;
            case 6:
                sectorName = "开发板块";
                break;
            case 7:
                sectorName = "鑫辰德";
                break;
            case 8:
                sectorName = "远融";
                break;
        }
    }

}
